package com.epam.edu.task02.Strings.textParts;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.epam.edu.task02.Strings.ConfigurationRegex;

public class Editor {
	public static String removeDoubleSpaceAndTab(String text) {
		String regex = ConfigurationRegex.getDoubleSpaceAndTab();
		Pattern pattern = Pattern.compile(regex);
		Matcher matcher = pattern.matcher(text);
		while (matcher.find()) {
			text = text.replaceAll(regex, " ");
		}
		return text;
	}
}
